
// ES6 class 
class Dog {
    constructor(name,breed) {
        this.name = name;
        this.breed = breed;
    }
    bark() { // 声明方法不用使用 function 关键字
        console.log('gogogog ');
    }
    static info() { // static 用来声明静态方法
        console.log('a dog is better then a cat ten times');
    }

    get description() { // get 关键字用来设置一个 get方法
        return `${this.name} is a ${this.breed} type of dog`;
    }

    set setname(name) {
        this.name = name;
    }
    get getname() {
        return this.name;
    }

}

const snickers = new Dog('snickers','King Charles');
console.log(Dog.info());

console.log(snickers.getname);